#include "mapget.h"
#include "ui_mapget.h"
mapget::mapget(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::mapget)
{
    ui->setupUi(this);
    QString recpath="1.武汉大学牌坊->12.珞珈广场->5.宋卿体育馆->3.万林艺术博物馆->13.半山庐->9.行政楼->8.九一二操场->10.梅园操场->4.鉴湖->11.鲲鹏广场->2.樱花大道->6.老图书馆->7.理学楼->15.凌波门";
    ui->pathEdit->setText(recpath);
}

mapget::~mapget()
{
    delete ui;
}


void mapget::on_pushButton_4_clicked()
{
    if(ui->SpotdEdit->text()=="1"){
        QString str="梅园食堂（距离为700m）";
        ui->Cname->setText(str);
    }


   else if(ui->SpotdEdit->text()=="2"){
        QString str="梅园食堂（距离为500m）";
        ui->Cname->setText(str);
    }


    else if(ui->SpotdEdit->text()=="3"){
        QString str="梅园食堂（距离为530m）";
        ui->Cname->setText(str);
    }


    else if(ui->SpotdEdit->text()=="4"){
        QString str="梅园食堂（距离为520m）";
        ui->Cname->setText(str);
    }


    else if(ui->SpotdEdit->text()=="5"){
        QString str="桂园食堂（距离为310m）";
        ui->Cname->setText(str);
    }


    else if(ui->SpotdEdit->text()=="6"){
        QString str="梅园食堂（距离为650m）";
        ui->Cname->setText(str);
    }


    else if(ui->SpotdEdit->text()=="7"){
        QString str="梅园食堂（距离为750m）";
        ui->Cname->setText(str);
    }


   else if(ui->SpotdEdit->text()=="8"){
        QString str="梅园食堂（距离为740m）";
        ui->Cname->setText(str);
    }


   else if(ui->SpotdEdit->text()=="9"){
        QString str="梅园食堂（距离为700m）";
        ui->Cname->setText(str);
    }


   else if(ui->SpotdEdit->text()=="10"){
        QString str="梅园食堂（距离为860m）";
        ui->Cname->setText(str);
    }


    else if(ui->SpotdEdit->text()=="11"){
        QString str="桂园食堂（距离为280m）";
        ui->Cname->setText(str);
    }


    else if(ui->SpotdEdit->text()=="12"){
        QString str="梅园食堂（距离为600m）";
        ui->Cname->setText(str);
    }


    else if(ui->SpotdEdit->text()=="13"){
        QString str="枫园食堂（距离为610m）";
        ui->Cname->setText(str);
    }

    else if(ui->SpotdEdit->text()=="14"){
        QString str="信部四食堂（距离为130m）";
        ui->Cname->setText(str);
    }


    else if(ui->SpotdEdit->text()=="15"){
        QString str="湖滨食堂（距离为210m）";
        ui->Cname->setText(str);
    }
    else
    {ui->Cname->clear();
        s=new search_error;
        s->show();

    }
}


void mapget::on_pushButton_3_clicked()
{
    close();
}

void mapget::on_pushButton_clicked()
{
    a=new attraction;
    a->show();
}

